﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace DefeatEpidemic.Models
{
    public class WxOauth
    {
        [Key]
        public Guid id { get; set; } = Guid.NewGuid();

        [StringLength(30, ErrorMessage = "{0}长度不能超出{1}个字符")]
        public string oauth_name { get; set; } = "xiaochengxu";

        [StringLength(50, ErrorMessage = "{0}长度不能超出{1}个字符")]
        public string open_id { get; set; }

        [StringLength(50, ErrorMessage = "{0}长度不能超出{1}个字符")]
        public string unionid { get; set; }

        [StringLength(50, ErrorMessage = "{0}长度不能超出{1}个字符")]
        public string nick_name { get; set; }

        [StringLength(200, ErrorMessage = "{0}长度不能超出{1}个字符")]
        public string avatar { get; set; }

        [StringLength(20)]
        public string mobile { get; set; }

        public DateTime created_at { get; set; } = DateTime.Now;


        public int type { get; set; } = 0;

        /// <summary>
        /// 纬度
        /// </summary>
        public double lat { get; set; }
        /// <summary>
        /// 经度
        /// </summary>
        public double lon { get; set; }
        /// <summary>
        /// 准确度
        /// </summary>
        public double accuracy { get; set; }

        public virtual Member member { get; set; }
    }
}
